<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>

<div class="content-wrap">
    <div class="wrapper" style="bottom: 50px;">
        <ul class="nav nav-tabs">
            <li>
                <a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/drug/drugStorageDept/index')">药品库存单位字典列表</a>
            </li>
            <li class="active">
                <a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/drug/drugStorageDept/form')">
                    <c:choose>
                        <c:when test="${drugStorageDept.id==''|| drugStorageDept.id==null}">
                            药品库存单位字典添加
                        </c:when>
                        <c:otherwise>药品库存单位字典修改</c:otherwise>
                    </c:choose>
                </a>
            </li>
        </ul>
        <section class="panel panel-default">
            <div class="panel-body">
                <div class="col-lg-12">
                    <form:form id="inputForm" data-parsley-validate="" modelAttribute="drugStorageDept"
                               onsubmit="return formSaveLoad('mainCenterDiv','inputForm','${ctx}/drug/drugStorageDept/save','${ctx}/drug/drugStorageDept/index');"
                               method="post" class="form-horizontal">
                        <form:hidden path="storageName"/>
                        <form:hidden path="id"/>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">单位名称：</label>

                            <div class="col-sm-4">
                                <sys:treeselect selectedParent="true"
                                                id="storageCode" update="false" isnull="true"
                                                name="storageCode" value="${drugStorageDept.storageCode}"
                                                labelName="${drugStorageDept.storageName}"
                                                labelValue="${drugStorageDept.storageName}" title="科室"
                                                url="/sys/orgDept/treeData" cssClass="form-control"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">单位性质：</label>

                            <div class="col-sm-4">
                                <form:select data-parsley-required="true" path="storageType" htmlEscape="false"
                                             class="form-control">
                                    <form:option value="" label=""/>
                                    <form:options items="${fns:getDictList('DRUG_STORAGE_TYPE')}" itemLabel="label"
                                                  itemValue="value" htmlEscape="false"/>
                                </form:select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">付款单前缀：</label>

                            <div class="col-sm-4">
                                <form:input data-parsley-required="true" path="disburseNoPrefix" htmlEscape="false"
                                            class="form-control"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">当前付款单号：</label>

                            <div class="col-sm-4">
                                <form:input data-parsley-required="true" path="disburseNoAva" htmlEscape="false"
                                            class="form-control"/>
                            </div>
                        </div>
                        <%--  <div class="form-group">
                              <label class="col-sm-2 control-label">出库单可用流水号：</label>
                              <div class="col-sm-4">
                                  <form:input data-parsley-required="true" path="exportNoAva" htmlEscape="false" class="form-control"  />
                              </div>
                          </div>--%>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">出库单号前缀：</label>

                            <div class="col-sm-4">
                                <form:input data-parsley-required="true" path="exportNoPrefix" htmlEscape="false"
                                            class="form-control"/>
                            </div>
                        </div>
                        <%--  <div class="form-group">
                              <label class="col-sm-2 control-label">入库单可用流水号：</label>
                              <div class="col-sm-4">
                                  <form:input data-parsley-required="true" path="importNoAva" htmlEscape="false" class="form-control"  />
                              </div>
                          </div>--%>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">入库单号前缀：</label>

                            <div class="col-sm-4">
                                <form:input data-parsley-required="true" path="importNoPrefix" htmlEscape="false"
                                            class="form-control"/>
                            </div>
                        </div>
                        <%--  <div class="form-group">
                              <label class="col-sm-2 control-label">是否纳入药柜范畴：</label>
                              <div class="col-sm-4">
                                  <form:input data-parsley-validate="" path="ygFlag" htmlEscape="false" class="form-control"  />
                              </div>
                          </div>--%>
                        <%--    <div class="form-group">
                                <label class="col-sm-2 control-label">对应药柜护理单元：</label>
                                <div class="col-sm-4">
                                    <form:input data-parsley-validate="" path="wardCode" htmlEscape="false" class="form-control"  />
                                </div>
                            </div>--%>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">备注信息：</label>

                            <div class="col-sm-4">
                                <form:textarea path="remarks" htmlEscape="false" rows="3" class="form-control"
                                               maxlength="1000"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" onclick="a()">&nbsp;
                                <input id="btnCancel" class="btn" type="button" value="返 回"
                                       onclick="loadDiv('mainCenterDiv','${ctx}/drug/drugStorageDept/index')">
                            </div>
                        </div>
                    </form:form>
                </div>

            </div>
        </section>
    </div>
</div>
<script>
    //如果标题是修改属性，那么单位名称不可修改不可编辑更改
    var idValue = document.getElementById('id').value;
    console.log(idValue);
    if(idValue !="" && idValue !=null){
        $("#storageCodeName").attr("disabled",true);
        $("#storageCodeButton").attr("disabled",true);
    }
</script>